package compiler.terminals;

import compiler.HowlToken;
import compiler.HowlType;
import compiler.TokenReader;
import compiler.exceptions.HowlParserException;

/**
 * Class to represent the geolocation of a data provider.
 * 
 * @author Sarah Mount <s.mount@wlv.ac.uk>
 * @version 16 Dec 2009
 * 
 * @see compiler.nonterminals.RegisterStmt
 * @see compiler.terminals.DataProvider
 * @see compiler.terminals.Number
 */
public class Geolocation extends HowlToken {

	private Number longtitude;
	private Number latitude;

	public Geolocation(TokenReader tokenReader) {
		super(tokenReader);
	}

	@Override
	public String codeGenerate() {
		return this.toString();
	}

	@Override
	public HowlToken parse() throws HowlParserException {
		this.longtitude = (Number) new Number(this.tokenReader).parse();
		this.latitude = (Number) new Number(this.tokenReader).parse();
		return this;
	}

	@Override
	public String toString() {
		return this.longtitude.toString() + " " + this.latitude.toString();
	}

	/**
	 * @return the longtitude
	 */
	public Number getLongtitude() {
		return longtitude;
	}

	/**
	 * @param longtitude the longtitude to set
	 */
	public void setLongtitude(Number longtitude) {
		this.longtitude = longtitude;
	}

	/**
	 * @return the latitude
	 */
	public Number getLatitude() {
		return latitude;
	}

	/**
	 * @param latitude the latitude to set
	 */
	public void setLatitude(Number latitude) {
		this.latitude = latitude;
	}
}
